/**
 * 2019年1月1日上午10:27:50
 * @author 谢进财
 */
package com.baihang.project.ds.webSocket.service;

import org.springframework.stereotype.Service;

import com.baihang.framework.service.BaseService;
import com.baihang.project.ds.config.SystemConfig;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * @author whati
 *
 */
@Service
public class WebSocketService extends BaseService {
	
	public String changeSystemConfigs(String json) {
		JSONArray jsonArray = JSONArray.fromObject(json);
		for(int i=0;i<jsonArray.size();i++) {
			JSONObject jsonObject = jsonArray.getJSONObject(i);
			if(SystemConfig.configMap.containsKey(jsonObject.getString("Name"))) {
				SystemConfig.configMap.put(jsonObject.getString("Name"), jsonObject.getString("Value"));
			}
		}
		return "ok";
	}
}
